package main

import "fmt"

// self defined type
type PersonInfo struct {
	ID   string
	Name string
	Addr string
}

func main() {
	var personDB map[string]PersonInfo
	personDB = make(map[string]PersonInfo)

	// insert several piece of info
	personDB["12345"] = PersonInfo{"12345", "Tom", "Room 203"}
	personDB["13456"] = PersonInfo{"13456", "Bob", "Room 101"}

	// search personal info
	person, ok := personDB["12345"]
	if ok {
		fmt.Println("Found person ", person.Name, "with ID ", person.ID)
	} else {
		fmt.Println("Did not find person with ID 1234.")
	}
}
